<include file="Index/header"/>
<script language="javascript" type="text/javascript" src="__PUBLIC__/My97DatePicker/WdatePicker.js"></script>
<style>
    .teacher {
        margin-left: 20px;
        border: solid 1px #ccc;

    }

    .teacher td {
        height: 50px;
        margin-left: 20px;
        width: 500px;
        border: solid 1px #ccc;
        line-height: 50px;
    }

    .teacher select {

        margin-left: 20px;
    }

    .teacher input {
        width: 100px;
        margin-left: 20px;

    }

    .input-xlarge {
        width: 600px;
        height: 100px;

    }
</style>

<include file="Index/left"/>


<div class="content">

    <div class="header">

        <h1 class="page-title">编辑资料</h1>
    </div>

    <ul class="breadcrumb">
        <li><a href="{:U('Index/Index')}">首页</a> <span class="divider">/</span></li>
        <li><a href="#">档案管理</a> <span class="divider">/</span></li>
        <li class="active">教师信息管理</li>
    </ul>

    <div class="container-fluid">
        <div class="row-fluid">
            <div class="well" id='well2'>
                <ul class="nav nav-tabs">
                    <li class="active"><a href="#home" data-toggle="tab">修改教师信息</a></li>
                </ul>
                <div id="myTabContent" class="tab-content">
                    <div class="tab-pane active in" id="home">
                        <form id="tab">
                            <table width="95%" border="0" class="teacher">
                                <tr>
                                    <td>&nbsp;&nbsp;
                                        <span style="color: red">*</span>&nbsp;教&nbsp;师&nbsp;工&nbsp;号
                                        <input type='hidden' value='{$us.id}' name='id'>
                                        <input type="text" value="{$us.tid}" name="tid" id="tid" class="input-xlarge"
                                               style="width:50%;margin-top: 2%" maxlength="8">
                                    </td>

                                    <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                        <span style="color: red">*</span>姓&nbsp;名
                                        <input type="text" value="{$us.tname}" name="tname" id="tname"
                                               class="input-xlarge" style="width: 50%;margin-top: 2%">
                                    </td>

                                    <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                        <span style="color: red">*</span>性&nbsp;别
                                        <select name="sex" id="sex" style="width: 55%;margin-top: 2%">
                                            <option value="{$us.sex}">{$us.sex}</option>
                                            <option value="男">男</option>
                                            <option value="女">女</option>
                                        </select>
                                    </td>
                                </tr>

                                <tr>
                                    <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                        籍&nbsp;贯
                                        <input type="text" value="{$us.nation}" name="nation" class="input-xlarge"
                                               style="width:50%;margin-top: 2%">
                                    </td>
                                    <td>&nbsp;&nbsp;
                                        入&nbsp;职&nbsp;时&nbsp;间
                                        <input type="text" value="{$us.entrydate}" name="EntryDate" class="input-xlarge"
                                               onClick="WdatePicker()" style="width:50%;margin-top: 2%"></td>
                                    <td>&nbsp;&nbsp;
                                        出&nbsp;生&nbsp;日&nbsp;期
                                        <input type="text" value="{$us.birth}" name="Birth" class="input-xlarge"
                                               onClick="WdatePicker()" style="width:50%;margin-top: 2%">
                                    </td>
                                </tr>

                                <tr>
                                    <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                        电&nbsp;话
                                        <input type="text" value="{$us.telephone}" name="telephone" class="input-xlarge"
                                               style="width:50%;margin-top: 2%">
                                    </td>

                                    <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                        手&nbsp;机
                                        <input type="text" value="{$us.mobilephone}" name="mobilephone"
                                               class="input-xlarge"
                                               style="width:50%;margin-top: 2%">
                                    </td>

                                    <td>&nbsp;&nbsp;
                                        电&nbsp;子&nbsp;邮&nbsp;件
                                        <input type="text" value="{$us.email}" name="email" class="input-xlarge"
                                               style="width:50%;margin-top: 2%">
                                    </td>
                                </tr>

                                <tr>
                                    <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                        <span style="color: red">*</span>类&nbsp;型
                                        <select name="type" id="type" style="width: 55%;margin-top: 2%">
                                            <option value="">请选择</option>
                                            <option value="1">接班老师</option>
                                            <option value="2">带班老师</option>
                                            <option value="3">值班领导</option>
                                        </select>
                                    </td>
                                </tr>

                                <script type="text/javascript">
                                    $("#type").val("<?=isset($us["type"])?trim($us["type"]):"" ?>");
                                </script>
                                <tr>
                                    <td colspan="3"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;备&nbsp;注&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                        <textarea name="remark" style="width: 82.5%;margin-top: 1%" cols="50" rows="6" id="remark" class="input-xlarge">{$us.remark}</textarea>
                                    </td>
                                </tr>
                                <!--  <tr><td colspan="3">   备&nbsp;&nbsp;&nbsp;&nbsp;注2:&nbsp;&nbsp;&nbsp;&nbsp;
                                          <textarea cols="50" rows="6" name="crc" class="input-xlarge">{$us.crc}</textarea></td></tr>-->
                            </table>
                            <br><br/>
                            <button style="margin-left:280px" type="button" class="btn btn-primary" onclick="tj()">确&nbsp;&nbsp;&nbsp;&nbsp;定</button>
                            <button type="button" class="btn btn-primary" onclick="history.go(-1)">取&nbsp;&nbsp;&nbsp;&nbsp;消</button>
                        </form>
                    </div>

                </div>
            </div>

        </div>

        <footer>
            <hr>


        </footer>

    </div>
</div>
</div>

<script type="text/javascript">
    function tj() {
        var tid = $('#tid').val();
        var sex = $('#sex').val();
        var tname = $('#tname').val();
        var remark = $('#remark').val().length;
        if (remark > 100) {

            alert('备注超过最大字数限制');
            return
        }
        if (tid === '') {
            alert('教师编号不能为空');
            $("#tid").focus();
            return;
        }
        if (sex === '') {
            alert('请选择性别');
            $("#sex").focus();
            return;

        }
        if (tname === '') {
            alert('教师姓名不能为空');
            $("#tname").focus();
            return;

        }
        $.ajax({
            type: "POST",
            url: "__CONTROLLER__/Teacherxg",

            cache: false,
            data: $('#tab').serialize(),

            success: function (data) {
                switch (data) {

                    case '0':
                        alert('用户修改成功');
                        window.location.replace("__CONTROLLER__/Teacher")
                        break;
                    case '1':
                        alert('用户修改失败');

                        break;

                    default:
                        alert(data);
                }

            }


        })


    }
</script>

<script src="__PUBLIC__/lib/bootstrap/js/bootstrap.js"></script>
<script type="text/javascript">
    $("[rel=tooltip]").tooltip();
    $(function () {
        $('.demo-cancel-click').click(function () {
            return false;
        });
    });
</script>

</body>
</html>


